display-error-chain
A lightweight library for displaying errors and their sources.
A sample output:
// `TopLevel` is caused by a `MidLevel`.
;
impl_error!;
// `MidLevel` is caused by a `LowLevel`.
;
impl_error!;
// `LowLevel` is the cause itself.
;
impl_error!;
// Now let's see how it works:
let formatted = new.to_string;
assert_eq!;
// Or with `.chain()` helper:
use ErrorChainExt as _;
let formatted = TopLevel.chain.to_string;
assert_eq!;
// Or even with `.into_chain()` helper to consume the error.
use ErrorChainExt as _;
let formatted = TopLevel.into_chain.to_string;
assert_eq!;
License: Apache-2.0/MIT